{include file="public/common" /}

<form class="layui-form" id="order_form">
    <div class="layui-form-item" style="margin-top: 10px">
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input type="text" name="search_" value="<?php echo isset($param['search_'])?$param['search_']:''?>"
                       autocomplete="off" class="layui-input" placeholder="搜索订单号/用户名称..">
            </div>
        </div>
        <div class="layui-inline">
            <button type="submit" class="layui-btn">筛选</button>
            <!--<a class="layui-btn" name="export" value="1" onclick="export_data()">导出数据</a>-->
        </div>
    </div>
</form>

<div>
    <table class="layui-table" width="900px">
        <thead>
        <tr style="text-align: center;">
            <td>订单号</td>
            <td>用户</td>
            <td>用户电话</td>
            <td>收货地址</td>
            <td>商家名称</td>
            <td>商家地址</td>
            <td>售后备注</td>
            <td>状态</td>
            <td>操作</td>
        </tr>
        </thead>
        <tbody>
        {volist name="list_" id="order"}
        <tr style="text-align: center;">
            <td> {$order.order_id}</td>
            <td> {$order.user_name}</td>
            <td> {$order.telephone}</td>
            <td> {$order.address}</td>
            <td> {$order.seller_name}</td>
            <td> {$order.seller_address}</td>
            <td> {$order.memo}</td>
            <td>
                {if condition='$order.status == 1'}
                <button class="layui-btn layui-btn-small">已处理</button>
                {else}
                <button class="layui-btn layui-btn-small layui-btn-danger">未处理</button>
                {/if}
            <td>
                <button class="layui-btn layui-btn-small"
                        onclick="model('/addons/execute/admin-order-customer_service_handle?order_id={$order.order_id}')">
                    售后处理
                </button><button class="layui-btn layui-btn-small" onclick="model('/addons/execute/admin-order-order_details?order_id={$order.order_id}')">订单详情</button>
            </td>

        </tr>
        {/volist}
        </tbody>
    </table>
    {$list_->render()}
</div>

<script>
    /**
     * 导出数据
     */
    function export_data() {
        $data = $('#order_form').serialize();
        var href = "/addons/execute/admin-order-list_?export=1&" + $data;
        window.open(href);
        return false;
    }
</script>